package com.sun.customs;

import java.util.List;
import java.util.Map;

import com.sun.news.R;

import android.content.Context;
import android.view.View;
import android.view.ViewGroup;
import android.widget.SimpleAdapter;
import android.widget.TextView;

public class MySimpleAdapter extends SimpleAdapter {
	
	private final int INIT_POSITION = 0;
	private Context mContext;

	public MySimpleAdapter(Context context,
			List<? extends Map<String, ?>> data, int resource, String[] from,
			int[] to) {
		super(context, data, resource, from, to);
		
		this.mContext = context;
	}
	
	@Override
	public View getView(int position, View convertView, ViewGroup parent) {
		// TODO Auto-generated method stub
		View v = super.getView(position, convertView, parent);
		
		if(position == INIT_POSITION){
			TextView categoryTitle = (TextView)v;
			categoryTitle.setTextColor(mContext.getResources().getColor(R.color.white));
			categoryTitle.setBackgroundResource(R.drawable.categorybar_item_background);
		}
		
		return v;
	}

}
